#include<bits/stdc++.h>

using namespace std;

int main() {
    int N;
    cin >> N;

    while (N--) {
        int m;
        cin >> m;
        int s = 0;
        for (int i = 1; i <= m; i++) {

            for (int j = 1; j <= i; j++) {
                s += j;
            }
        }


        cout << s << endl;

    }

    return 0;
}
